package com.lc.config;

import java.util.concurrent.*;

/**
 * @author liuc
 * @date 2021/5/5
 * @description
 **/
public class ExecutorFactory {

    private static final RejectedExecutionHandler defaultHandler =
            new ThreadPoolExecutor.AbortPolicy();
    
    public static ThreadPoolExecutor defaultExecutor(){
        return new ThreadPoolExecutor(10, 
                50,
                60,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<Runnable>(100),
                Executors.defaultThreadFactory(),
                defaultHandler);
    }
}
